<template>
    <div>
        <div align="center" style="font-weight: bold;font-size: 20px;margin-bottom: 20px;">{{showMonth}}统计报表</div>
        <!-- <h3 style="text-align:center">{{factShowTime}}统计报表</h3> -->
        <h4 style="text-align:right;width: 1100px;margin: 0 auto;font-weight: 400;">
            <span>统计月度：{{startTime | filtersDatetime}}-01至{{endTime | filtersDatetime}}</span>
            <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
            <span>单位：TEU</span>
        </h4>
        <table class="all-tab" border="1" cellspacing="0" style="width: 1100px;text-align: center;">
            <tr>
                <td>类别</td>
                <td colspan="2">类型</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.portName}}</td>
            </tr>
            <tr>
                <td>装箱</td>
                <td colspan="2">场站装箱</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.total}}</td>
            </tr>
            <!--<tr>
                <td>厂外装箱</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.CZtotal}}</td>
            </tr>
            <tr class="td-bg">
                <td>小计</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.CZXtotal}}</td>
            </tr>-->
            <tr class="td-bg2">
                <td rowspan="3">拆箱</td>
                <td colspan="2">港内掏箱</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.CXgn}}</td>
            </tr>
            <tr class="td-bg2">
                <td colspan="2">整箱提运</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.CXzx}}</td>
            </tr>
            <tr class="td-bg">
                <td colspan="2">小计</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.CXtotal}}</td>
            </tr>
            <tr>
                <td rowspan="5">进口</td>
                <td colspan="2">艘次</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.ivoyage}}</td>
            </tr>
            <tr>
                <td rowspan="2">重箱</td>
                <td>中转</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.iwaterTeu}}</td>
            </tr>
            <tr>
                <td>非中转</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.inoWaterTeu}}</td>
            </tr>
            <tr>
                <td colspan="2">空箱</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.iemptyTeu}}</td>
            </tr>
            <!--<tr>
                <td>水转水</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.iwaterTeu}}</td>
            </tr>
            <tr>
                <td>非水转水</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.inoWaterTeu}}</td>
            </tr>-->
            <tr class="td-bg">
                <td colspan="2">理箱量</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.iTotal}}</td>
            </tr>
            <tr class="td-bg2">
                <td rowspan="6">出口</td>
                <td colspan="2">艘次</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.ovoyage}}</td>
            </tr>
            <tr class="td-bg2">
                <td rowspan="3">重箱</td>
                <td>港装</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.ogzteu}}</td>
            </tr>
            <tr>
                <td class="td-bg2">厂装</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.oczteu}}</td>
            </tr>
            <tr>
                <td class="td-bg2">中转</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.owaterTeu}}</td>
            </tr>
            <tr class="td-bg2">
                <td colspan="2">空箱</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.oemptyTeu}}</td>
            </tr>
            <!--<tr class="td-bg2">
                <td colspan="2">水转水</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.owaterTeu}}</td>
            </tr>
            <tr class="td-bg2">
                <td colspan="2">非水转水</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.onoWaterTeu}}</td>
            </tr>-->
            <tr class="td-bg">
                <td colspan="2">理箱量</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.oTotal}}</td>
            </tr>
            <tr>
                <td rowspan="3">特殊作业</td>
                <td colspan="2">熏蒸</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.xz}}</td>
            </tr>
            <tr>
                <td colspan="2">二转</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.ez}}</td>
            </tr>
            <tr class="td-bg">
                <td colspan="2">理箱量</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.xzTotal}}</td>
            </tr>
            <tr class="td-bg">
                <td colspan="3">总艘次</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.totalV}}</td>
            </tr>
            <tr class="td-bg">
                <td colspan="3">理重箱量</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.totalH}}</td>
            </tr>
            <tr class="td-bg">
                <td colspan="3">理空箱量</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.totalE}}</td>
            </tr>
            <tr class="td-bg">
                <td colspan="3">总理箱量</td>
                <td v-for="(x,k) in tabelData" :key="k">{{x.totalAll}}</td>
            </tr>
        </table>
    </div>
</template>

<script>
    import { getOperationTotalReportByMonth } from "@/api/balance/balance";
    import {
        getLocalTime
    } from "@/utils/dateFormat";
    export default {
        name: "monthShipName",
        data() {
            return {
                showMonth :'',
                startTime: getLocalTime(new Date(), 'YYYY-MM'),
                endTime: getLocalTime(new Date(), 'YYYY-MM-DD'),
                tabelData: [],
                tabelDataTB: [],
                tabelDataHB: [],
                list : []
            }
        },
        created() {
            this.loadData()
        },
        methods: {
            loadData() {
                this.showMonth=this.$route.query.factShowTime
                this.tabelData = JSON.parse(localStorage.getItem('productTabelData'))
                this.$nextTick(() => {
                    setTimeout(function(){
                        window.print()
                        window.close();
                    },1000)
                })
            }
        }
    }
</script>

<style scoped>

</style>
